package com.example.cdctest.service.impl;

import com.example.cdctest.mapper.AdminMapper;
import com.example.cdctest.pojo.Admin;
import com.example.cdctest.service.AdminService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class AdminServiceImpl implements AdminService {
    @Resource
    private AdminMapper adminMapper;
    @Override
    public void insert(Admin object) {

    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(Admin object) {

    }

    @Override
    public Admin findById(Integer id) {
        return null;
    }

    @Override
    public List<Admin> findAll() {
        return null;
    }

    @Override
    public PageInfo<Admin> findPage(int pageSize) {
        return null;
    }

    //管理员登录
    @Override
    public Admin adminLogin(Admin admin) {
        return adminMapper.findAdmin(admin);
    }

    //取出所有管理员
    @Override
    public List<Admin> getadmin() {return adminMapper.getAdmin(); }
    //添加管理员
    @Override
    public void adminadd(Admin admin) {
        adminMapper.insertSelective(admin);
    }

    @Override
    public void updateAdmin(Admin admin) { adminMapper.updateAdmin(admin); }

    @Override
    public void tingyongAdmin(Integer id) { adminMapper.updateTingQiAdmin(id);}

    @Override
    public  void adminUpdate(Admin admin){ adminMapper.adminUpadte(admin);}

}
